<template>
  <div>
    <Row :gutter="16">
      <Col span="4">
        <DeptTree
        @on-dept-change="onDeptChange"
        />
      </Col>
      <Col span="20">
        <UserTable
        :deptCode="deptCode"
        />
      </Col>
    </Row>
  </div>
</template>

<script>
import UserTable from './user-table'
import DeptTree from './dept-tree'
export default {
  name: 'UserIndex',
  components: {
    UserTable,
    DeptTree
  },
  data () {
    return {
      deptCode: null
    }
  },
  methods: {
    onDeptChange (deptCode) {
      this.deptCode = deptCode
    }
  }
}
</script>
